import { Injectable, Logger } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { ConfigService } from '@nestjs/config';
import { BaseService } from '@wwjCommon/base/base.service';
import { CacheService } from '@wwjCommon/cache/cache.service';
import { LoggingService } from '@wwjCommon/logging/logging.service';
import { UploadService } from '@wwjVendor/upload/upload.service';
import { PayService } from '@wwjVendor/pay/pay.service';
import { SmsService } from '@wwjVendor/sms/sms.service';
import { NoticeService } from '@wwjVendor/notice/notice.service';

@Injectable()
export class ConfigService extends BaseService<any> {
  private readonly logger = new Logger(ConfigService.name);

  constructor(
    @InjectRepository(Object)
    protected readonly repository: Repository<any>,
    private readonly cacheService: CacheService,
    private readonly configService: ConfigService,
    private readonly loggingService: LoggingService,
    private readonly uploadService: UploadService,
    private readonly payService: PayService,
    private readonly smsService: SmsService,
    private readonly noticeService: NoticeService,
  ) {
    super(repository);
  }

  /**
   * getCopyright
   * 对应 PHP: ConfigService_admin::getCopyright()
   * 逻辑类型: undefined - undefined
   */
  async getCopyright() {
    // 基于PHP真实逻辑: getCopyright
    // PHP原文: return ( new CoreSysConfigService() )->getCopyright($this->site_id);     }      /**      * 设置版权信息(整体设置，不按照站点)      * @param array $value      * @retur...
return ( this.coreSysConfigService ).getCopyright(this.site_id);
    }

    /**
     * 设置版权信息(整体设置，不按照站点)
     * @param value
     * @return bool
     */
    async setCopyright(value)
    {
        const data = [
            icp: value[ 'icp' ],
            gov_record: value[ 'gov_record' ],
            gov_url: value[ 'gov_url' ],
            market_supervision_url: value[ 'market_supervision_url' ],
            logo: value[ 'logo' ],
            company_name: value[ 'company_name' ],
            copyright_link: value[ 'copyright_link' ],
            copyright_desc: value[ 'copyright_desc' ]
        ];
        return this.core_config_service.setConfig(this.site_id, 'COPYRIGHT', data);
    }

    /**
     * 获取网站信息
     * @return */
    async getWebSite()
    {
        const info = ( this.siteService ).getInfo(this.site_id];
        const service_info = this.getService(];
        info.site_login_logo = service_info[ 'site_login_logo' ];
        info.site_login_bg_img = service_info[ 'site_login_bg_img' );
        return info;
    }

    /**
     * 设置网站信息
     * @return bool
     */
    async setWebSite(data)
    {
        return ( this.siteService ).edit(this.site_id, data];
    }

    /**
     * 获取前端域名
     * @return array|string[)
     */
    async getSceneDomain()
    {
        return ( this.coreSysConfigService ).getSceneDomain(this.site_id);
    }

    /**
     * 获取服务信息
     * @return array|mixed
     */
    async getService()
    {
        const info = ( this.coreConfigService ).getConfig(0, 'SERVICE_INFO')[ 'value' ] || [];
        return [
            wechat_code: info[ 'wechat_code' ] || '',
            enterprise_wechat: info[ 'enterprise_wechat' ] || '',
            site_login_logo: info[ 'site_login_logo' ] || '',
            site_login_bg_img: info[ 'site_login_bg_img' ] || 'static/resource/images/site/login_bg.jpg',
            tel: info[ 'tel' ] || '',
        ];
    }

    /**
     * 设置服务信息
     * @param value
     * @return bool
     */
    async setService(value)
    {
        const data = [
            wechat_code: value[ 'wechat_code' ],
            site_login_logo: value[ 'site_login_logo' ],
            site_login_bg_img: value[ 'site_login_bg_img' ],
            enterprise_wechat: value[ 'enterprise_wechat' ],
            tel: value[ 'tel' ]
        ];
        return this.core_config_service.setConfig(0, 'SERVICE_INFO', data);
    }

    /**
     * 设置地图key
     * @param value
     * @return bool
     */
    async setMap(value)
    {
        const data = [
            key: value[ 'key' ],
            amap_key: value.amap_key,
            is_open: value[ 'is_open' ], // 是否开启定位
            valid_time: value[ 'valid_time' ] // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
        ];
        if (this.site_id == request().defaultSiteId()) {
            ( this.coreH5Service ).mapKeyChange(value[ 'key' )];
  }

  /**
   * setCopyright
   * 对应 PHP: ConfigService_admin::setCopyright()
   * 逻辑类型: undefined - undefined
   */
  async setCopyright(value: any[]) {
    // 基于PHP真实逻辑: setCopyright
    // PHP原文: $data = [             'icp' => $value[ 'icp' ],             'gov_record' => $value[ 'gov_record' ],             'gov_url' => $value[ 'gov_url' ],     ...
const data = [
            icp: value[ 'icp' ],
            gov_record: value[ 'gov_record' ],
            gov_url: value[ 'gov_url' ],
            market_supervision_url: value[ 'market_supervision_url' ],
            logo: value[ 'logo' ],
            company_name: value[ 'company_name' ],
            copyright_link: value[ 'copyright_link' ],
            copyright_desc: value[ 'copyright_desc' ]
        ];
        return this.core_config_service.setConfig(this.site_id, 'COPYRIGHT', data);
    }

    /**
     * 获取网站信息
     * @return */
    async getWebSite()
    {
        const info = ( this.siteService ).getInfo(this.site_id];
        const service_info = this.getService(];
        info.site_login_logo = service_info[ 'site_login_logo' ];
        info.site_login_bg_img = service_info[ 'site_login_bg_img' );
        return info;
    }

    /**
     * 设置网站信息
     * @return bool
     */
    async setWebSite(data)
    {
        return ( this.siteService ).edit(this.site_id, data];
    }

    /**
     * 获取前端域名
     * @return array|string[)
     */
    async getSceneDomain()
    {
        return ( this.coreSysConfigService ).getSceneDomain(this.site_id);
    }

    /**
     * 获取服务信息
     * @return array|mixed
     */
    async getService()
    {
        const info = ( this.coreConfigService ).getConfig(0, 'SERVICE_INFO')[ 'value' ] || [];
        return [
            wechat_code: info[ 'wechat_code' ] || '',
            enterprise_wechat: info[ 'enterprise_wechat' ] || '',
            site_login_logo: info[ 'site_login_logo' ] || '',
            site_login_bg_img: info[ 'site_login_bg_img' ] || 'static/resource/images/site/login_bg.jpg',
            tel: info[ 'tel' ] || '',
        ];
    }

    /**
     * 设置服务信息
     * @param value
     * @return bool
     */
    async setService(value)
    {
        const data = [
            wechat_code: value[ 'wechat_code' ],
            site_login_logo: value[ 'site_login_logo' ],
            site_login_bg_img: value[ 'site_login_bg_img' ],
            enterprise_wechat: value[ 'enterprise_wechat' ],
            tel: value[ 'tel' ]
        ];
        return this.core_config_service.setConfig(0, 'SERVICE_INFO', data);
    }

    /**
     * 设置地图key
     * @param value
     * @return bool
     */
    async setMap(value)
    {
        const data = [
            key: value[ 'key' ],
            amap_key: value.amap_key,
            is_open: value[ 'is_open' ], // 是否开启定位
            valid_time: value[ 'valid_time' ] // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
        ];
        if (this.site_id == request().defaultSiteId()) {
            ( this.coreH5Service ).mapKeyChange(value[ 'key' )];
  }

  /**
   * getWebSite
   * 对应 PHP: ConfigService_admin::getWebSite()
   * 逻辑类型: undefined - undefined
   */
  async getWebSite() {
    // 基于PHP真实逻辑: getWebSite
    // PHP原文: $info = ( new SiteService() )->getInfo($this->site_id);         $service_info = $this->getService();         $info['site_login_logo'] = $service_info[...
const info = ( this.siteService ).getInfo(this.site_id];
        const service_info = this.getService(];
        info.site_login_logo = service_info[ 'site_login_logo' ];
        info.site_login_bg_img = service_info[ 'site_login_bg_img' );
        return info;
    }

    /**
     * 设置网站信息
     * @return bool
     */
    async setWebSite(data)
    {
        return ( this.siteService ).edit(this.site_id, data];
    }

    /**
     * 获取前端域名
     * @return array|string[)
     */
    async getSceneDomain()
    {
        return ( this.coreSysConfigService ).getSceneDomain(this.site_id);
    }

    /**
     * 获取服务信息
     * @return array|mixed
     */
    async getService()
    {
        const info = ( this.coreConfigService ).getConfig(0, 'SERVICE_INFO')[ 'value' ] || [];
        return [
            wechat_code: info[ 'wechat_code' ] || '',
            enterprise_wechat: info[ 'enterprise_wechat' ] || '',
            site_login_logo: info[ 'site_login_logo' ] || '',
            site_login_bg_img: info[ 'site_login_bg_img' ] || 'static/resource/images/site/login_bg.jpg',
            tel: info[ 'tel' ] || '',
        ];
    }

    /**
     * 设置服务信息
     * @param value
     * @return bool
     */
    async setService(value)
    {
        const data = [
            wechat_code: value[ 'wechat_code' ],
            site_login_logo: value[ 'site_login_logo' ],
            site_login_bg_img: value[ 'site_login_bg_img' ],
            enterprise_wechat: value[ 'enterprise_wechat' ],
            tel: value[ 'tel' ]
        ];
        return this.core_config_service.setConfig(0, 'SERVICE_INFO', data);
    }

    /**
     * 设置地图key
     * @param value
     * @return bool
     */
    async setMap(value)
    {
        const data = [
            key: value[ 'key' ],
            amap_key: value.amap_key,
            is_open: value[ 'is_open' ], // 是否开启定位
            valid_time: value[ 'valid_time' ] // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
        ];
        if (this.site_id == request().defaultSiteId()) {
            ( this.coreH5Service ).mapKeyChange(value[ 'key' )];
  }

  /**
   * setWebSite
   * 对应 PHP: ConfigService_admin::setWebSite()
   * 逻辑类型: undefined - undefined
   */
  async setWebSite(data: any) {
    // 基于PHP真实逻辑: setWebSite
    // PHP原文: return ( new SiteService() )->edit($this->site_id, $data);     }      /**      * 获取前端域名      * @return array|string[]      */     public function getS...
return ( this.siteService ).edit(this.site_id, data];
    }

    /**
     * 获取前端域名
     * @return array|string[)
     */
    async getSceneDomain()
    {
        return ( this.coreSysConfigService ).getSceneDomain(this.site_id);
    }

    /**
     * 获取服务信息
     * @return array|mixed
     */
    async getService()
    {
        const info = ( this.coreConfigService ).getConfig(0, 'SERVICE_INFO')[ 'value' ] || [];
        return [
            wechat_code: info[ 'wechat_code' ] || '',
            enterprise_wechat: info[ 'enterprise_wechat' ] || '',
            site_login_logo: info[ 'site_login_logo' ] || '',
            site_login_bg_img: info[ 'site_login_bg_img' ] || 'static/resource/images/site/login_bg.jpg',
            tel: info[ 'tel' ] || '',
        ];
    }

    /**
     * 设置服务信息
     * @param value
     * @return bool
     */
    async setService(value)
    {
        const data = [
            wechat_code: value[ 'wechat_code' ],
            site_login_logo: value[ 'site_login_logo' ],
            site_login_bg_img: value[ 'site_login_bg_img' ],
            enterprise_wechat: value[ 'enterprise_wechat' ],
            tel: value[ 'tel' ]
        ];
        return this.core_config_service.setConfig(0, 'SERVICE_INFO', data);
    }

    /**
     * 设置地图key
     * @param value
     * @return bool
     */
    async setMap(value)
    {
        const data = [
            key: value[ 'key' ],
            amap_key: value.amap_key,
            is_open: value[ 'is_open' ], // 是否开启定位
            valid_time: value[ 'valid_time' ] // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
        ];
        if (this.site_id == request().defaultSiteId()) {
            ( this.coreH5Service ).mapKeyChange(value[ 'key' )];
  }

  /**
   * getSceneDomain
   * 对应 PHP: ConfigService_admin::getSceneDomain()
   * 逻辑类型: undefined - undefined
   */
  async getSceneDomain() {
    // 基于PHP真实逻辑: getSceneDomain
    // PHP原文: return ( new CoreSysConfigService() )->getSceneDomain($this->site_id);     }      /**      * 获取服务信息      * @return array|mixed      */     public func...
return ( this.coreSysConfigService ).getSceneDomain(this.site_id);
    }

    /**
     * 获取服务信息
     * @return array|mixed
     */
    async getService()
    {
        const info = ( this.coreConfigService ).getConfig(0, 'SERVICE_INFO')[ 'value' ] || [];
        return [
            wechat_code: info[ 'wechat_code' ] || '',
            enterprise_wechat: info[ 'enterprise_wechat' ] || '',
            site_login_logo: info[ 'site_login_logo' ] || '',
            site_login_bg_img: info[ 'site_login_bg_img' ] || 'static/resource/images/site/login_bg.jpg',
            tel: info[ 'tel' ] || '',
        ];
    }

    /**
     * 设置服务信息
     * @param value
     * @return bool
     */
    async setService(value)
    {
        const data = [
            wechat_code: value[ 'wechat_code' ],
            site_login_logo: value[ 'site_login_logo' ],
            site_login_bg_img: value[ 'site_login_bg_img' ],
            enterprise_wechat: value[ 'enterprise_wechat' ],
            tel: value[ 'tel' ]
        ];
        return this.core_config_service.setConfig(0, 'SERVICE_INFO', data);
    }

    /**
     * 设置地图key
     * @param value
     * @return bool
     */
    async setMap(value)
    {
        const data = [
            key: value[ 'key' ],
            amap_key: value.amap_key,
            is_open: value[ 'is_open' ], // 是否开启定位
            valid_time: value[ 'valid_time' ] // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
        ];
        if (this.site_id == request().defaultSiteId()) {
            ( this.coreH5Service ).mapKeyChange(value[ 'key' )];
  }

  /**
   * getService
   * 对应 PHP: ConfigService_admin::getService()
   * 逻辑类型: undefined - undefined
   */
  async getService() {
    // 基于PHP真实逻辑: getService
    // PHP原文: $info = ( new CoreConfigService() )->getConfig(0, 'SERVICE_INFO')[ 'value' ] ?? [];         return [             'wechat_code' => $info[ 'wechat_code'...
const info = ( this.coreConfigService ).getConfig(0, 'SERVICE_INFO')[ 'value' ] || [];
        return [
            wechat_code: info[ 'wechat_code' ] || '',
            enterprise_wechat: info[ 'enterprise_wechat' ] || '',
            site_login_logo: info[ 'site_login_logo' ] || '',
            site_login_bg_img: info[ 'site_login_bg_img' ] || 'static/resource/images/site/login_bg.jpg',
            tel: info[ 'tel' ] || '',
        ];
    }

    /**
     * 设置服务信息
     * @param value
     * @return bool
     */
    async setService(value)
    {
        const data = [
            wechat_code: value[ 'wechat_code' ],
            site_login_logo: value[ 'site_login_logo' ],
            site_login_bg_img: value[ 'site_login_bg_img' ],
            enterprise_wechat: value[ 'enterprise_wechat' ],
            tel: value[ 'tel' ]
        ];
        return this.core_config_service.setConfig(0, 'SERVICE_INFO', data);
    }

    /**
     * 设置地图key
     * @param value
     * @return bool
     */
    async setMap(value)
    {
        const data = [
            key: value[ 'key' ],
            amap_key: value.amap_key,
            is_open: value[ 'is_open' ], // 是否开启定位
            valid_time: value[ 'valid_time' ] // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
        ];
        if (this.site_id == request().defaultSiteId()) {
            ( this.coreH5Service ).mapKeyChange(value[ 'key' )];
  }

  /**
   * setService
   * 对应 PHP: ConfigService_admin::setService()
   * 逻辑类型: undefined - undefined
   */
  async setService(value: any[]) {
    // 基于PHP真实逻辑: setService
    // PHP原文: $data = [             "wechat_code" => $value[ 'wechat_code' ],             "site_login_logo" => $value[ 'site_login_logo' ],             "site_login_...
const data = [
            wechat_code: value[ 'wechat_code' ],
            site_login_logo: value[ 'site_login_logo' ],
            site_login_bg_img: value[ 'site_login_bg_img' ],
            enterprise_wechat: value[ 'enterprise_wechat' ],
            tel: value[ 'tel' ]
        ];
        return this.core_config_service.setConfig(0, 'SERVICE_INFO', data);
    }

    /**
     * 设置地图key
     * @param value
     * @return bool
     */
    async setMap(value)
    {
        const data = [
            key: value[ 'key' ],
            amap_key: value.amap_key,
            is_open: value[ 'is_open' ], // 是否开启定位
            valid_time: value[ 'valid_time' ] // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
        ];
        if (this.site_id == request().defaultSiteId()) {
            ( this.coreH5Service ).mapKeyChange(value[ 'key' )];
  }

  /**
   * setMap
   * 对应 PHP: ConfigService_admin::setMap()
   * 逻辑类型: undefined - undefined
   */
  async setMap(value: any[]) {
    // 基于PHP真实逻辑: setMap
    // PHP原文: $data = [             'key' => $value[ 'key' ],             'amap_key' => $value['amap_key'],             'is_open' => $value[ 'is_open' ], // 是否开启定位 ...
const data = [
            key: value[ 'key' ],
            amap_key: value.amap_key,
            is_open: value[ 'is_open' ], // 是否开启定位
            valid_time: value[ 'valid_time' ] // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
        ];
        if (this.site_id == request().defaultSiteId()) {
            ( this.coreH5Service ).mapKeyChange(value[ 'key' )];
  }

  /**
   * getMap
   * 对应 PHP: ConfigService_admin::getMap()
   * 逻辑类型: undefined - undefined
   */
  async getMap() {
    // 基于PHP真实逻辑: getMap
    // PHP原文: $info = ( new CoreConfigService() )->getConfig($this->site_id, 'MAPKEY');         if (empty($info)) {             $info = [];             $info[ 'valu...
const info = ( this.coreConfigService ).getConfig(this.site_id, 'MAPKEY');
        if (!info)) {
            const info = [];
            info[ 'value' ] = [
                key: '',
                amap_key: '',
                is_open: 1, // 是否开启定位
                valid_time: 5 // 定位有效期/分钟，过期后将重新获取定位信息，0为不过期
            ];
  }

  /**
   * getWapIndexList
   * 对应 PHP: ConfigService_admin::getWapIndexList()
   * 逻辑类型: undefined - undefined
   */
  async getWapIndexList(data: any[]) {
    // 基于PHP真实逻辑: getWapIndexList
    // PHP原文: return ( new CoreSysConfigService() )->getWapIndexList($data);     }      /**      * 获取开发者key      * @return array      */     public function getDeve...
return ( this.coreSysConfigService ).getWapIndexList(data);
    }

    /**
     * 获取开发者key
     * @return */
    async getDeveloperToken()
    {
        return ( this.coreConfigService ).getConfigValue(0, "DEVELOPER_TOKEN");
    }

    /**
     * 设置开发者key
     * @param data
     * @return */
    async setDeveloperToken(data)
    {
        return ( this.coreConfigService ).setConfig(0, "DEVELOPER_TOKEN", data);
    }

    /**
     * 获取开发者key
     * @return */
    async getLayout()
    {
        return ( this.coreConfigService ).getConfigValue(0, "LAYOUT_SETTING");
    }

    /**
     * 设置布局风格
     * @param data
     * @return */
    async setLayout(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "LAYOUT_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "LAYOUT_SETTING", config);
    }

    /**
     * 获取色调设置
     * @return */
    async getThemeColor()
    {
        return ( this.coreConfigService ).getConfigValue(0, "THEMECOLOR_SETTING");
    }

    /**
     * 设置色调
     * @param data
     * @return */
    async setThemeColor(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "THEMECOLOR_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "THEMECOLOR_SETTING", config);
    }


}
  }

  /**
   * getDeveloperToken
   * 对应 PHP: ConfigService_admin::getDeveloperToken()
   * 逻辑类型: undefined - undefined
   */
  async getDeveloperToken() {
    // 基于PHP真实逻辑: getDeveloperToken
    // PHP原文: return ( new CoreConfigService() )->getConfigValue(0, "DEVELOPER_TOKEN");     }      /**      * 设置开发者key      * @param array $data      * @return arra...
return ( this.coreConfigService ).getConfigValue(0, "DEVELOPER_TOKEN");
    }

    /**
     * 设置开发者key
     * @param data
     * @return */
    async setDeveloperToken(data)
    {
        return ( this.coreConfigService ).setConfig(0, "DEVELOPER_TOKEN", data);
    }

    /**
     * 获取开发者key
     * @return */
    async getLayout()
    {
        return ( this.coreConfigService ).getConfigValue(0, "LAYOUT_SETTING");
    }

    /**
     * 设置布局风格
     * @param data
     * @return */
    async setLayout(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "LAYOUT_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "LAYOUT_SETTING", config);
    }

    /**
     * 获取色调设置
     * @return */
    async getThemeColor()
    {
        return ( this.coreConfigService ).getConfigValue(0, "THEMECOLOR_SETTING");
    }

    /**
     * 设置色调
     * @param data
     * @return */
    async setThemeColor(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "THEMECOLOR_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "THEMECOLOR_SETTING", config);
    }


}
  }

  /**
   * setDeveloperToken
   * 对应 PHP: ConfigService_admin::setDeveloperToken()
   * 逻辑类型: undefined - undefined
   */
  async setDeveloperToken(data: any[]) {
    // 基于PHP真实逻辑: setDeveloperToken
    // PHP原文: return ( new CoreConfigService() )->setConfig(0, "DEVELOPER_TOKEN", $data);     }      /**      * 获取开发者key      * @return array      */     public fun...
return ( this.coreConfigService ).setConfig(0, "DEVELOPER_TOKEN", data);
    }

    /**
     * 获取开发者key
     * @return */
    async getLayout()
    {
        return ( this.coreConfigService ).getConfigValue(0, "LAYOUT_SETTING");
    }

    /**
     * 设置布局风格
     * @param data
     * @return */
    async setLayout(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "LAYOUT_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "LAYOUT_SETTING", config);
    }

    /**
     * 获取色调设置
     * @return */
    async getThemeColor()
    {
        return ( this.coreConfigService ).getConfigValue(0, "THEMECOLOR_SETTING");
    }

    /**
     * 设置色调
     * @param data
     * @return */
    async setThemeColor(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "THEMECOLOR_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "THEMECOLOR_SETTING", config);
    }


}
  }

  /**
   * getLayout
   * 对应 PHP: ConfigService_admin::getLayout()
   * 逻辑类型: undefined - undefined
   */
  async getLayout() {
    // 基于PHP真实逻辑: getLayout
    // PHP原文: return ( new CoreConfigService() )->getConfigValue(0, "LAYOUT_SETTING");     }      /**      * 设置布局风格      * @param array $data      * @return array  ...
return ( this.coreConfigService ).getConfigValue(0, "LAYOUT_SETTING");
    }

    /**
     * 设置布局风格
     * @param data
     * @return */
    async setLayout(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "LAYOUT_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "LAYOUT_SETTING", config);
    }

    /**
     * 获取色调设置
     * @return */
    async getThemeColor()
    {
        return ( this.coreConfigService ).getConfigValue(0, "THEMECOLOR_SETTING");
    }

    /**
     * 设置色调
     * @param data
     * @return */
    async setThemeColor(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "THEMECOLOR_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "THEMECOLOR_SETTING", config);
    }


}
  }

  /**
   * setLayout
   * 对应 PHP: ConfigService_admin::setLayout()
   * 逻辑类型: undefined - undefined
   */
  async setLayout(data: any[]) {
    // 基于PHP真实逻辑: setLayout
    // PHP原文: $config_service = new CoreConfigService();         $config = $config_service->getConfigValue(0, "LAYOUT_SETTING");         $config[ $data[ 'key' ] ] =...
const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "LAYOUT_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "LAYOUT_SETTING", config);
    }

    /**
     * 获取色调设置
     * @return */
    async getThemeColor()
    {
        return ( this.coreConfigService ).getConfigValue(0, "THEMECOLOR_SETTING");
    }

    /**
     * 设置色调
     * @param data
     * @return */
    async setThemeColor(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "THEMECOLOR_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "THEMECOLOR_SETTING", config);
    }


}
  }

  /**
   * getThemeColor
   * 对应 PHP: ConfigService_admin::getThemeColor()
   * 逻辑类型: undefined - undefined
   */
  async getThemeColor() {
    // 基于PHP真实逻辑: getThemeColor
    // PHP原文: return ( new CoreConfigService() )->getConfigValue(0, "THEMECOLOR_SETTING");     }      /**      * 设置色调      * @param array $data      * @return array...
return ( this.coreConfigService ).getConfigValue(0, "THEMECOLOR_SETTING");
    }

    /**
     * 设置色调
     * @param data
     * @return */
    async setThemeColor(data)
    {
        const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "THEMECOLOR_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "THEMECOLOR_SETTING", config);
    }


}
  }

  /**
   * setThemeColor
   * 对应 PHP: ConfigService_admin::setThemeColor()
   * 逻辑类型: undefined - undefined
   */
  async setThemeColor(data: any[]) {
    // 基于PHP真实逻辑: setThemeColor
    // PHP原文: $config_service = new CoreConfigService();         $config = $config_service->getConfigValue(0, "THEMECOLOR_SETTING");         $config[ $data[ 'key' ]...
const config_service = this.coreConfigService;
        const config = config_service.getConfigValue(0, "THEMECOLOR_SETTING"];
        config[ data[ 'key' ] ] = data[ 'value' );
        return ( this.coreConfigService ).setConfig(0, "THEMECOLOR_SETTING", config);
    }


}
  }
}
